#ifndef CANSENDER_H
#define CANSENDER_H
#include <string>
#include <array>
#include <optional>
#include "Logger.h"

struct can_frame;

namespace canpp {
    using std::string;
    using std::array;
    using std::optional;
    using std::nullopt;
    using bq::log;

    class CanSender {
    public:
        CanSender() = delete;

        ~CanSender();

        explicit CanSender(string &&canInterface, optional<string> &&id = nullopt);

        explicit CanSender(const string &canInterface, const optional<string> &id = nullopt);

        void canSend(const can_frame &&frame) const;

        [[nodiscard]] string get_id() const {
            return id;
        }

    private:
        log logger;
        string interface;
        string id;
        int fd;
        string LOG_DIR;
        string LOGGER_NAME;
    };
} // canpp

#endif //CANSENDER_H
